package com.easy.api;

import com.easy.api.bean.api.OpenConfig;
import com.easy.api.bean.decrypt.EncryptionBean;
import com.utils.AESUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Author liuyuan
 * @Date 2020-04-23 12:51
 * @Version 1.0
 */
@Configuration
@ComponentScan({"com.channel"})
public class EasyApiConfiguration {


    @Bean("openConfig")
    public OpenConfig getOpenConfig(){
        OpenConfig openConfig = new OpenConfig();
        openConfig.setAppId("wxd21ecc79b39fa803");
        return openConfig;
    }

    @Bean("encryptionBean")
    public EncryptionBean getEncryptionBean(){
        EncryptionBean encryptionBean = new EncryptionBean();
        /**
         * 加密工具类
         * */
        encryptionBean.setClassBean(AESUtils.class);
        /**
         * 工具类解密的方法
         * */
        encryptionBean.setDecrypt("aesDecrypt");
        /**
         * 工具类加密的方法
         * */
        encryptionBean.setEncrypt("aesEncrypt");
        /**
         * 密钥
         * */
        encryptionBean.setKey("abcdefgabcdefg12");
        /**
         * 解密的请求参数
         * */
        encryptionBean.setRequestParam("str");
        /**
         * 是否生效注解 默认true
         * */
        encryptionBean.setOpen(true);
        return encryptionBean;
    }




}
